import Router from 'koa-router';
import dataMock from './datamock'

const router = new Router();

// 获取计数
router.get('/procure/moon', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [{"value":687,"name":"空气层"},{"value":940,"name":"罗马布"},{"value":199,"name":"TR粗针"},{"value":465,"name":"T/R斜纹"},{"value":681,"name":"全涤楼梯布"},{"value":569,"name":"莫代尔单面"},{"value":490,"name":"T/R竖条星空纹"},{"value":87,"name":"75D雪纺珠"},{"value":774,"name":"弹力缎"},{"value":974,"name":"亮片剪花"},{"value":448,"name":"气流冰丝绉"},{"value":313,"name":"仿醋酸"},{"value":889,"name":"涤平纹四面弹"},{"value":831,"name":"75D高捻雪纺"},{"value":662,"name":"T/R汗布"},{"value":382,"name":"CEY平纹"},{"value":359,"name":"锦包棉网纹"},{"value":301,"name":"哥弟纹"},{"value":556,"name":"TR包芯纱"}],
  };
});
// 获取计数
router.get('/procure/prediction', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [{"value":29,"name":"特效去油灵TF-101C"},{"value":68,"name":"乳化去油剂TF-115D"},{"value":261,"name":"氨纶精炼去油剂TF-109HA"},{"value":810,"name":"双氧水27.5%"},{"value":474,"name":"多功能精炼剂ONE"},{"value":66,"name":"低温消泡剂TF-508C"},{"value":132,"name":"中性抛光酶XH-778"},{"value":733,"name":"特黑增深剂TF-413"},{"value":311,"name":"冰醋酸"},{"value":201,"name":"纯碱"},{"value":469,"name":"锦纶匀染剂2007"},{"value":430,"name":"分散匀染剂TF-213HA"},{"value":637,"name":"保险粉"},{"value":472,"name":"酸性固色剂889E(新)"},{"value":331,"name":"还原清洗粉TF-288BF"},{"value":23,"name":"元明粉"},{"value":642,"name":"六偏取代剂"},{"value":454,"name":"分散印花增稠剂TF-316M"},{"value":356,"name":"尿素"},{"value":822,"name":"色普印RT-50"},{"value":83,"name":"海藻酸钠（鹰飞）"},{"value":876,"name":"分散糊料L-F8"},{"value":359,"name":"蓬松柔软剂53新)"},{"value":786,"name":"平滑YF-217"},{"value":3,"name":"柔滑YF-968"},{"value":825,"name":"蓬松YF-850B"},{"value":994,"name":"肉感厚实YF-318"},{"value":463,"name":"亲肤舒GR-新507-2"},{"value":277,"name":"硅油821"},{"value":298,"name":"分散深蓝HGL 200%"},{"value":868,"name":"分散黑HW-SR"},{"value":271,"name":"分散橙RSE300%"},{"value":484,"name":"分散黄棕NP-WECT200%"},{"value":323,"name":"分散红3B 100%"},{"value":348,"name":"分散红玉WRUT200%"},{"value":222,"name":"分散蓝2BLN 100%"},{"value":803,"name":"分散蓝HW-SF BS"},{"value":963,"name":"活性红C-B"},{"value":258,"name":"活性红3BS"},{"value":521,"name":"活性超级黑W-NN 200%"},{"value":312,"name":"活性黄3RS"},{"value":828,"name":"活性橙C-3R"},{"value":431,"name":"活性深蓝M-2GE"},{"value":815,"name":"活性艳蓝KN-R100%"},{"value":946,"name":"活性黑SW-W"},{"value":455,"name":"酸性红N-BG"},{"value":35,"name":"酸性藏青S-R"},{"value":820,"name":"酸性黄N-R"},{"value":85,"name":"酸性蓝N-R"},{"value":541,"name":"酸性红M-RS"},{"value":187,"name":"酸性红N-2BL"},{"value":605,"name":"酸性红N-2RBL"},{"value":92,"name":"酸性翠蓝N-3G"},{"value":795,"name":"阳离子蓝X-BL 250%"},{"value":982,"name":"阳离子红X-GRL 250%"},{"value":429,"name":"阳离子金黄28#X-GL 250%"}],
  };
});
// 获取计数
router.get('/procure/plan/p10020', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [{"value":688,"name":"特效去油灵TF-101C"},{"value":490,"name":"乳化去油剂TF-115D"},{"value":101,"name":"氨纶精炼去油剂TF-109HA"},{"value":873,"name":"双氧水27.5%"},{"value":474,"name":"多功能精炼剂ONE"},{"value":341,"name":"低温消泡剂TF-508C"},{"value":949,"name":"中性抛光酶XH-778"},{"value":488,"name":"特黑增深剂TF-413"},{"value":237,"name":"冰醋酸"},{"value":795,"name":"纯碱"},{"value":552,"name":"锦纶匀染剂2007"},{"value":944,"name":"分散匀染剂TF-213HA"},{"value":810,"name":"保险粉"},{"value":927,"name":"酸性固色剂889E(新)"},{"value":373,"name":"还原清洗粉TF-288BF"},{"value":152,"name":"元明粉"},{"value":661,"name":"六偏取代剂"},{"value":82,"name":"分散印花增稠剂TF-316M"},{"value":710,"name":"尿素"},{"value":943,"name":"色普印RT-50"},{"value":708,"name":"海藻酸钠（鹰飞）"},{"value":592,"name":"分散糊料L-F8"},{"value":20,"name":"蓬松柔软剂53新)"},{"value":485,"name":"平滑YF-217"},{"value":540,"name":"柔滑YF-968"},{"value":993,"name":"蓬松YF-850B"},{"value":699,"name":"肉感厚实YF-318"},{"value":620,"name":"亲肤舒GR-新507-2"},{"value":975,"name":"硅油821"}],
  };
});
// 获取计数
router.get('/procure/plan/p10021', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [{"value":510,"name":"分散深蓝HGL 200%"},{"value":948,"name":"分散黑HW-SR"},{"value":117,"name":"分散橙RSE300%"},{"value":175,"name":"分散黄棕NP-WECT200%"},{"value":246,"name":"分散红3B 100%"},{"value":862,"name":"分散红玉WRUT200%"},{"value":666,"name":"分散蓝2BLN 100%"},{"value":733,"name":"分散蓝HW-SF BS"},{"value":828,"name":"活性红C-B"},{"value":623,"name":"活性红3BS"},{"value":284,"name":"活性超级黑W-NN 200%"},{"value":365,"name":"活性黄3RS"},{"value":499,"name":"活性橙C-3R"},{"value":312,"name":"活性深蓝M-2GE"},{"value":1004,"name":"活性艳蓝KN-R100%"},{"value":575,"name":"活性黑SW-W"},{"value":790,"name":"酸性红N-BG"},{"value":626,"name":"酸性藏青S-R"},{"value":31,"name":"酸性黄N-R"},{"value":342,"name":"酸性蓝N-R"},{"value":491,"name":"酸性红M-RS"},{"value":520,"name":"酸性红N-2BL"},{"value":249,"name":"酸性红N-2RBL"},{"value":433,"name":"酸性翠蓝N-3G"},{"value":996,"name":"阳离子蓝X-BL 250%"},{"value":701,"name":"阳离子红X-GRL 250%"},{"value":914,"name":"阳离子金黄28#X-GL 250%"}],
  };
});
// 获取计数
router.get('/procure/plan/p21221', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: dataMock['p21221']
  };
});
// 获取计数
router.get('/procure/plan/p11001', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: dataMock['p11001']
  };
});
// 获取计数
router.get('/procure/plan/p11002', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: dataMock['p11002']
  };
});

// 获取计数
router.get('/procure/material/all', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [{"name":"分散深蓝HGL 200%","cnt":"4090","rate":"12","status":"up","remark":"建议新增供应链","err":"【****有限公司】退货率异常"},{"name":"分散黑HW-SR","cnt":"2302","rate":"10","status":"up","remark":"建议新增供应链"},{"name":"活性黄3RS","cnt":"6090","rate":"10","status":"down","supplier":{"name":"纳派化学(上海)有限公司","taxId":"91310115054569606W","address":"绍兴市柯桥区玉兰国际西区2703室"},"remark":""},{"name":"活性黑SW-W","cnt":"90","rate":"10","status":"down","supplier":{"name":"绍兴德美新材料有限公司","taxId":"91330621698283515E","address":"绍兴柯桥区滨海工业区中心路"},"remark":""},{"name":"酸性藏青S-R","cnt":"990","rate":"12","status":"up","supplier":{"name":"杭州美高华颐化工有限公司","taxId":"91330109732015064U","address":"杭州市萧山区经济技术开发区桥南区块鸿发踏80号"},"remark":""},{"name":"酸性黄N-R","cnt":"60","rate":"0.2","status":"up","supplier":{"name":"传化智联股份有限公司","taxId":"91330000609301348W","address":"杭州萧山经济技术开发区"},"remark":""}],
  };
});
// 获取计数
router.get('/procure/sale/all', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [{"name":"杭州","cnt":"6","status":"up","remark":"建议加大供应"},{"name":"上海","cnt":"3","status":"","remark":""},{"name":"北京","cnt":"4","status":"down","remark":"建议减小供应"},{"name":"重庆","cnt":"4","status":"down","supplier":{"name":"绍兴德美新材料有限公司","taxId":"91330621698283515E","address":"绍兴柯桥区滨海工业区中心路"},"remark":""},{"name":"莆田","cnt":"2","status":"up","remark":"建议加大供应"},{"name":"酸性黄N-R","cnt":"2","status":"up","remark":"建议加大供应"}]
  };
});
// 获取计数
router.get('/procure/history/sale', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [
      {
        name: '苏州安桥纺织有限公司',
        category: '30110#仿铜氨竹节',
        cnt: 133386
      },
      {
        name: '苏州安桥纺织有限公司',
        category: '30312#锦棉消光布',
        cnt: 532
      },
      {
        name: '苏州安桥纺织有限公司',
        category: 'H408#NR单丝猫眼',
        cnt: 18235
      },
      {
        name: '佰奕化纤（江苏）有限公司',
        category: '粘锦绉布',
        cnt: 716514
      },
      {
        name: '佰奕化纤（江苏）有限公司',
        category: '粘锦绉布-A',
        cnt: 63153
      },
      {
        name: '佰奕化纤（江苏）有限公司',
        category: '山本柔丝斜',
        cnt: 23450
      },
      {
        name: '绍兴市亚星布业有限公司',
        category: '63"16*12/108*56全棉纱卡',
        cnt: 176261
      },
      {
        name: '绍兴市亚星布业有限公司',
        category: '63"24/2*10/70*40全棉帆布',
        cnt: 78735
      },
      {
        name: '绍兴市亚星布业有限公司',
        category: "80'21*16+70D/116*48弹力纱卡",
        cnt: 31189
      },
      {
        name: '上海英腾国际贸易有限公司',
        category: '10SNR再生罗缎',
        cnt: 47258
      },
      {
        name: '上海英腾国际贸易有限公司',
        category: '10SNR罗缎',
        cnt: 25157
      },
      {
        name: '无锡艾莱美国际贸易有限公司',
        category: '10SNR罗缎ALM240427DH/0510DH',
        cnt: 12910
      },
      {
        name: '无锡艾莱美国际贸易有限公司',
        category: 'CVC21*150D+70D/100*60棉涤再生涤弹力小方格ALM240418DH',
        cnt: 15590
      },
      {
        name: '无锡艾莱美国际贸易有限公司',
        category: "63'10*10/44*38粘亚麻ALM240303DH",
        cnt: 12465
      }
    ]
  };
});
router.get('/procure/history/procure', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [
      {
        postName: '立信染整机械（广东）有限公司',
        supplyName: '轴封体Ⅲ',
        cnt: 2,
        unit: '只',
        address: '广东省中山市火炬开发区临海工业园'
      },
      {
        postName: '立信染整机械（广东）有限公司',
        supplyName: '轴封体Ⅰ',
        cnt: 4,
        unit: '只',
        address: '广东省中山市火炬开发区临海工业园'
      },
      {
        postName: '立信染整机械（广东）有限公司',
        supplyName: '轴封体Ⅱ',
        cnt: 2,
        unit: '只',
        address: '广东省中山市火炬开发区临海工业园'
      },
      {
        postName: '立信染整机械（广东）有限公司',
        supplyName: '轴封体Ⅴ',
        cnt: 2,
        unit: '只',
        address: '广东省中山市火炬开发区临海工业园'
      },
      {
        postName: '杭州金丰环保科技有限公司',
        supplyName: '聚合氯化铝（粉）',
        cnt: 2,
        unit: '吨',
        address: '杭州市萧山区'
      },
      {
        postName: '深圳市信宏印染流体控制有限公司',
        supplyName: '升降速模块超位表HE5120MOD',
        cnt: 1,
        unit: '只',
        address: '深圳市龙岗区平湖街道'
      },
      {
        postName: '绍兴亚仑工业品销售有限公司',
        supplyName: '套筒罗批7',
        cnt: 20,
        unit: '支',
        address: '绍兴'
      },
      {
        postName: '绍兴亚仑工业品销售有限公司',
        supplyName: '套筒罗批5.5mm',
        cnt: 20,
        unit: '支',
        address: '绍兴'
      },
      {
        postName: '绍兴亚仑工业品销售有限公司',
        supplyName: '除锈剂',
        cnt: 48,
        unit: '瓶',
        address: '绍兴'
      },
      {
        postName: '浙江宏都信息技术有限公司',
        supplyName: '680K打印机更换进纸组件',
        cnt: 1,
        unit: '台',
        address: '绍兴'
      },
      {
        postName: '瑞安市天华包装材料有限公司',
        supplyName: '编织袋100*165',
        cnt: 8000,
        unit: '只',
        address: '瑞安市塘下镇'
      },
      {
        postName: '绍兴市百胜缝制设备有限公司',
        supplyName: '五线拷边机牙齿',
        cnt: 30,
        unit: '付',
        address: '绍兴'
      },
      {
        postName: '绍兴市百胜缝制设备有限公司',
        supplyName: '四线牙齿700',
        cnt: 12,
        unit: '付',
        address: '绍兴'
      },
      {
        postName: '绍兴市百胜缝制设备有限公司',
        supplyName: '三线牙齿700',
        cnt: 12,
        unit: '只',
        address: '绍兴'
      },
      {
        postName: '宁波希莱特机电设备有限公司',
        supplyName: '液位变送器900MM',
        cnt: 2,
        unit: '套',
        address: '宁波'
      },
      {
        postName: '绍兴力富德机械有限公司',
        supplyName: '锂电液压车控制器1212P-2502',
        cnt: 1,
        unit: '只',
        address: '绍兴'
      },
      {
        postName: '绍兴力富德机械有限公司',
        supplyName: '加速器手柄总成（锂电车）',
        cnt: 1,
        unit: '只',
        address: '绍兴'
      },
      {
        postName: '浙江绍恩工贸有限公司',
        supplyName: '显控触摸屏EA-070B',
        cnt: 1,
        unit: '块',
        address: '绍兴'
      },
      {
        postName: '浙江绍恩工贸有限公司',
        supplyName: '触摸屏安装面板SJ-20180629',
        cnt: 1,
        unit: '块',
        address: '绍兴'
      },
      {
        postName: '浙江绍恩工贸有限公司',
        supplyName: '触摸屏外置盒SJ2018069',
        cnt: 1,
        unit: '块',
        address: '绍兴'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '毛刷杆B240L=2865',
        cnt: 20,
        unit: '件',
        address: '广东省中山市翠亨新区'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '毛刷橡皮带50M',
        cnt: 60,
        unit: '支',
        address: '广东省中山市翠亨新区'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '毛刷胶条（无粘性）',
        cnt: 60,
        unit: '支',
        address: '广东省中山市翠亨新区'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '毛刷条胶水',
        cnt: 20,
        unit: '瓶',
        address: '广东省中山市翠亨新区'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '紧定螺丝M6*8',
        cnt: 40,
        unit: '颗',
        address: '广东省中山市翠亨新区'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '对中球头（门富士原装）',
        cnt: 20,
        unit: '只',
        address: '广东省中山市翠亨新区'
      },
      {
        postName: '立信门富士纺织机械（中山）有限公司',
        supplyName: '尼龙活动块（门富士原装）',
        cnt: 60,
        unit: '只',
        address: '广东省中山市翠亨新区'
      }
    ]
  };
});
export default router;
